
import { loadInfoPersonInfoByCurr, loadSysParamListNoPage, loadBasePeopleListNoPage, loadAlDegreegraduInfo, loadInfoStutrainInfo } from "../../../services/trainingProgram"
export default {

  namespace: 'diplomaCertificationModule',
  state: {
    list: "",
    course: []
  },

  effects: {
    *loadInfoPersonInfoByCurrInfo({ payload }, { call, put }) {
      let data = yield loadInfoPersonInfoByCurr(payload)
      let data1 = yield loadSysParamListNoPage({code:'current_school_code'})
      let data5 = yield loadSysParamListNoPage({code:'current_school_name'})
      let data2 = yield loadBasePeopleListNoPage(payload)
      let data3 = yield loadAlDegreegraduInfo(payload)
      let data4 = yield loadInfoStutrainInfo({id:data.data.id})
      yield put({
        type: "setList",
        payload: {
          data,
          data1,
          data2,
          data3,
          data4,
          data5
        }
      })
    },
  },
  reducers: {
    setList(state, { payload }) {
      state.list = payload
      return { ...state, ...payload };
    },
    setCourse(state, { payload }) {
      state.course = payload
      return { ...state, ...payload };
    },
  },

};
